function [mySound]=mydist(max, sound)

mySound = sound;
scale = 0.5 / max;

for r=1:numel(sound)
    sample =  mySound(r, 1);
    if sample > max
        sample = max;
    end
    if sample < -max
        sample = -max;
    end
    mySound(r, 1) = sample * scale;
end

return;